package ooday03;

public class Test {
    public static void main(String[] args) {
        Dog dog =new Dog("小黄",5,"黄");
        System.out.println(dog.name);
        dog=null;
        System.out.println(dog.color);

        /*
        Dog[] dogs=new Dog[3];
        dogs[0]=new Dog("小黄",1,"黑");
        dogs[1]=new Dog("小黑",2,"黄");
        dogs[2]=new Dog("小绿",3,"红");
        System.out.println(dogs[0].color);
        dogs[0].name="小白";
        dogs[1].age=8;
        dogs[2].color="黑";
        dogs[2].swim();
        for (int i = 0; i < dogs.length; i++) {
            System.out.println(dogs[i].name);
            dogs[i].lookHome();
        }

        Chick[] chicks=new Chick[3];
        chicks[0]=new Chick("小红鸡",1,"红");
        chicks[1]=new Chick("小白鸡",2,"白");
        chicks[2]=new Chick("小黑鸡",3,"黑");
        for (int i = 0; i < chicks.length; i++) {
            System.out.println(chicks[i].age);
            chicks[i].fly();
        }

        Fish[] fish=new Fish[3];
        fish[0]=new Fish("小菜",2,"黑");
        fish[1]=new Fish("小徐",2,"黑");
        fish[2]=new Fish("小昆",2,"黑");
        for (int i = 0; i < fish.length; i++) {
            System.out.println(fish[i].name);
            fish[i].swim();
        }

         */
    }
}

